import axios from 'axios'

const state={
    payKinds:[],
    getKinds:[]
}

const getters={
    allPayKind:state =>{
        return state.payKinds
    },
    allGetKind:state=>{
        return state.getKinds
    }
}

const mutations={
    allPayKind(state,datas){
        state.payKinds=datas
    },
    allGetKind(state,datas){
        state.getKinds=datas
    }
}

const actions={
    allPayKind({commit}) {
        axios.get('http://localhost:9090/kind/findAll/2').then(resp => {
            commit('allPayKind', resp.data)
        })
    },
    allGetKind({commit}) {
        axios.get('http://localhost:9090/kind/findAll/1').then(resp => {
            commit('allGetKind', resp.data)
        })
    }
}

export default {
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}